package culosic.mdpocket.html;

public class NodeA extends HtmlNode
{
	private String href;
	private String title = null;
	
	public NodeA(String href){
		this.href = href;
	}
	
	public NodeA(String href, String title){
		set(href, title);
	}
	
	public void set(String href, String title){
		this.href = href;
		this.title = title;
	}
	
	@Override
	public void show(HtmlOut out)
	{
		out.pauseLevel();
		out.setText("<a href=\"" + href + "\""
				+ (title == null ? "" : (" title=\"" + title + "\""))
				+ ">");
		out.put();
		super.showChildren(out);
		out.setText("</a>\n");
		out.pauseLevel();
		out.put();
		out.recoverLevel();
	}
}
